﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Mode
{
    public class ExamChartData
    {
        public ExamChartData(DataTable dt)
        {
            if (dt == null)
                throw new Exception("取分数记录出错.");

            foreach (DataRow row in dt.Rows) {
                username.Add( row["name"].ToString() );
                srouce.Add( Convert.ToInt32( row["srouce"]  ) );
            }
        }

        private List<string> username = new List<string>();
        public string[] Username
        {
            get { return username.ToArray(); }
        }


        private List<int> srouce = new List<int>();
        public int[] Srouce
        {
            get { return srouce.ToArray(); }
        }
    }

    public class UserExamChart {
        public UserExamChart(DataTable dt) {
            if (dt == null)
                throw new Exception("取用户考试记录出错.");

            foreach (DataRow row in dt.Rows)
            {
                examname.Add(row["examname"].ToString() );
                score.Add( Convert.ToInt32(row["score"]) );
                pass.Add(Convert.ToInt32(row["passscore"]));
            }
        }

        private List<string> examname = new List<string>();
        public string[] Examname
        {
            get { return examname.ToArray(); }
        }

        private List<int> score = new List<int>();
        public int []Score
        {
            get { return score.ToArray(); }
        }

        private List<int> pass = new List<int>();
        public int []Pass
        {
            get { return pass.ToArray(); }
        }
    }
}
